<?php

class TujuanDao {

    public function getTujuan($id_tujuan) {
        require_once('class.database.php');
        $db = Database::getInstance();
        $con = $db->getConnection(1);

        $query = "SELECT * FROM ref_tujuan WHERE id_tujuan='$id_tujuan'";

        $result = $con->prepare($query);
        $result->execute();

        if ($result->rowCount() == 1) {
            $data = $result->fetch();
            return $data['nama_tujuan'];
        }

        return false;
    }

}

class Tujuan {

    var $id_tujuan;
    var $nama_tujuan;

}

?>
